#pragma once

#include <ArduinoJson.h>
#include "Event.h"

#define MSG_REG_REQ				0x01
#define MSG_REG_RES				0x02
#define MSG_NORMAL_REQ		0x03
#define MSG_NORMAL_RES		0x04
#define MSG_ONEWAY				0x05
#define MSG_PING						0x06
#define MSG_PONG					0x07

#define DATA_JSON					0x00
#define DATA_STREAM				0x01

typedef uint8_t MsgType;
typedef uint8_t DataFlag;

class SocketEvent : public Event
{
public:
	MsgType type = MSG_NORMAL_REQ;
	uint32_t sn = 0;
	DataFlag flag = 0;
	uint32_t length = 0;
	JsonObject* data = NULL;
	SocketEvent() {};
	~SocketEvent() {};
};

